package cn.huoyingkeji.system.controller;

import java.util.List;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.huoyingkeji.boot.BaseController;
import cn.huoyingkeji.common.domain.R;
import cn.huoyingkeji.system.dto.RoleDTO;
import cn.huoyingkeji.system.service.RoleService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

@RestController
@RequestMapping("/system/role")
@Tag(name = "角色信息")
public class SysRoleController extends BaseController<RoleDTO,RoleService> {
    public SysRoleController(){
        super.setControllerName("role");
    }


    @PostMapping("/setResoucesByRoleId/{roleId}")
    @Operation(summary = "赋予角色资源")
    public R setResoucesByRoleId(@PathVariable Long roleId,@RequestBody List<Long> resourceIds){
        return R.status(this.service.setResoucesByRoleId(roleId, resourceIds));
    }
}
